package com.ms.game.slot.base;

import com.xpec.c4.game.time.TimeSys;

public class SeatVerifyInfo 
{
	/**
	 * 認證過期時間
	 */
	public static final int VERIFY_EXPRIED_TIME = 20;
	

	public String seatid;
	
	public String guid;
	
	public String halltype;
	
	/**
	 * dm 玩家入座時間
	 */
	public long seattime;
	
	/**
	 * dm 通知時間
	 */
	public long notifytime;
	
	/**
	 * 過期時間
	 */
	private long expried_time;

	public SeatVerifyInfo() {
	}

	public SeatVerifyInfo
	(
			String halltype,
			String seatid,
			String guid,
			long seattime
	)
	{
		this.halltype = halltype;
		this.seatid = seatid;
		this.guid = guid;
		this.seattime = seattime;
		
		notifytime = TimeSys.currentTimeSec();
		expried_time =notifytime+ VERIFY_EXPRIED_TIME;
	}

	
	/**
	 * 是否過期
	 * @return
	 */
	public boolean isExpried()
	{
		long now = TimeSys.currentTimeSec();
		return (expried_time > now)? false:true;
	}
	
	/**
	 * 認證是否正確
	 * @return
	 */
	public boolean isVerifyOK(String halltype , String seatid , String playerguid)
	{
		boolean rs = false;
		if(
				this.halltype.equals(halltype) &&
				this.seatid.equals(seatid) &&
				this.guid.equals(playerguid)
				
		)
		{
			rs = true;
		}
		
		return rs;
	}
	
	// =========================================================

	public String getSeatid() {
		return seatid;
	}

	public void setSeatid(String seatid) {
		this.seatid = seatid;
	}

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getHalltype() {
		return halltype;
	}

	public void setHalltype(String halltype) {
		this.halltype = halltype;
	}

	public long getSeattime() {
		return seattime;
	}

	public void setSeattime(long seattime) {
		this.seattime = seattime;
	}

	public long getNotifytime() {
		return notifytime;
	}

	public void setNotifytime(long notifytime) {
		this.notifytime = notifytime;
	}

	public long getExpried_time() {
		return expried_time;
	}

	public void setExpried_time(long expried_time) {
		this.expried_time = expried_time;
	}
}
